package cn.xj.controller;

import cn.xj.entiy.User;
import cn.xj.service.IUserService;
import com.alibaba.druid.stat.DruidStatManagerFacade;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Title:
 * @description:
 * @Company: 北京九恒星科技股份有限公司
 * @author: wxf
 * @since: Create in 2022/6/22 10:03
 * @version: 1.0
 **/
@RestController
@RequestMapping("/test")
public class TestController {

    @Autowired
    private IUserService userServiceImpl;

    @RequestMapping("/test1")
    public List<User> test1(){
        return userServiceImpl.selectLists();
    }

    @GetMapping("/stat")
    public Object druidStat(){
        // 获取数据源的监控数据
        return DruidStatManagerFacade.getInstance().getDataSourceStatDataList();
    }
}
